home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Dynamo 4.2 for GSBug 1.5b10 / !! Latest Dynamo Info < prev    next >
Encoding:
Text File  |  1990-09-21  |  18.7 KB  |  421 lines  |  [TEXT/MPS ]

  1. The format of this document is for people who have the most recent version.
  2. The most current information is at the top.  If you are not familiar with
  3. Dynamo, or if you have skipped a version or two, you may want to read the
  4. information here in a different order than presented.
  5.  
  6.  
  7. _______________________________________________________________________________
  8.  
  9.  
  10. Dynamo 4.2 information:
  11.  
  12. There are only a few difference between 4.1 and 4.2.  The first is a small
  13. change in the ascii-to-int functions.  A - sign was allowed as the first
  14. character, but a + sign was not.  This caused ascii string starting with a
  15. + sign to immediately abort calculating the value, since the very first
  16. character was not correct.  This has been changed.  The + sign is simply
  17. ignored, and processing continues from the character after the + sign.
  18.  
  19. The second change is the addition of initial segment support.  Basically,
  20. everything works the same for transferring blocks of code/data, except
  21. that after moving the block, the block can be optionally called now.  This
  22. allows segments to be used to initialize stuff and then not be used again,
  23. thus freeing up the memory that those segments occupied.
  24.  
  25. The third change is support for GSBUG.  GSBUG needs 4 pages of consecutive
  26. RAM in the primary 48k of memory.  This new feature allows you to designate
  27. where this 1024 bytes of RAM is to start.
  28.  
  29. For more information on the initial segment support and the GSBUG support,
  30. see the file "buildapp.manual.text".
  31.  
  32.  
  33. _______________________________________________________________________________
  34.  
  35.  
  36. Dynamo 4.1 information:
  37.  
  38. BUILDAPP.SYSTEM didn't handle building an application that had auxiliary 48K
  39. memory segments.  This has been fixed.
  40.  
  41. There were a couple of floating-point problems.  f2i left error-trapping on,
  42. which is very bad, since the error-trapping waits for any character to be
  43. printed.  (This is the only way to trap AppleSoft floating-point errors.)
  44.  
  45. The startBinary routine called startBinary0.  This made the depth of the stack
  46. other than 2 rts's, which is wrong for the way error-trapping works.  This
  47. has been fixed.
  48.  
  49. The floating-point random number generator rfnd was sick.  It is better now.
  50.  
  51.  
  52. _______________________________________________________________________________
  53.  
  54.  
  55. Dynamo 4.0 information:
  56.  
  57. The big addition to Dynamo for the 4.0 version is floating-point support.
  58. The implementation uses the AppleSoft ROM routines.  This allows the
  59. implementation to remain small, which is one of Dynamo's trademarks.
  60. Any computational error is trapped, and flow-of-control is returned to
  61. the application, with the carry set, and the error code in the accumulator.
  62.  
  63. The implementation has no impact on page-zero utilization.  The zero-page
  64. and stack are preserved prior to any AppleSoft ROM call, so in the case of
  65. an error, the stack can be recovered, and in either case, zero-page can be
  66. restored.
  67.  
  68. The array handling was changed to accomodate the additional data size of
  69. 5 bytes.  The size parameter of the array macro was changed from being
  70. either a 'b' or a 'w' (for byte or word) to the physical size of an element.
  71. Note that there is now no restriction for sizes other than 1, 2 or 5 bytes.
  72. An element can be any size.  Of course, for sizes other than 1, 2, or 5
  73. bytes, you will have to supply your own array element access routines.
  74.  
  75. An attempt has been made to keep the syntax for floating-point as consistent
  76. as possible with the way integers were handled.  For the most part, floating-
  77. point macros start with _f.  This isn't always true .  There are some logical
  78. exceptions.  Once such exception is for converting an integer into a float.
  79. This macro is called _i2f, and the reverse function is called _f2i.  So,
  80. although there is no steadfast rule, the rule is consistent and logical enough
  81. to be useful.
  82.  
  83. Also, a change has been made to the variable space.  There can now be two
  84. variable spaces.  One of the variable spaces is the same old integer variable
  85. space.  The other, logically enough, is for floating-point numbers.  These
  86. two variables spaces can be the same 256 bytes (mixing floats with ints), or
  87. they can be separate 256 byte areas.  If they are the same space, then _i2f
  88. and _f2i convert the value in place.  If they are different spaces, then the
  89. value is converted and copied to the other variable space.  (What this means
  90. is that if you have two different variable spaces, you can have both an
  91. integer and a floating-point value for the same variable.  Weird.)
  92.  
  93. The same variable name (read same offset) is used into the variable space(s)
  94. for both the source and destination of the conversion, even if you have two
  95. variables spaces.  I now think that this may have been a mistake.  In any case,
  96. that is how it stands currently.  I may change this in the future.  The
  97. reasoning for this (I did have a reason for the current implementation) was
  98. that a program probably didn't have all that many floating-point numbers, and
  99. would probably be using the one-variable-space model.  Now I think that I
  100. should have implemented _i2f and _f2i so that they took two variable names,
  101. instead of just one as they do now.  With two variable names, I could designate
  102. a destination variable that is different than the source variable.  This would
  103. probably be more useful for a greater range of uses.  (Oh well.)
  104.  
  105.  
  106. _______________________________________________________________________________
  107.  
  108.  
  109. Dynamo 3.1 information:
  110.  
  111.  
  112.  
  113. I have been busy changing things for no reason at all, and here's where I stand:
  114. (This is a joke.  I had reasons.  I just can't remember what they were.)
  115. ((This is a joke.))
  116.  
  117.  
  118. 1)    BUILDAPP.SYSTEM has changed.  The new build script sample looks like this:
  119.  
  120. DUMMY                            ;The default script filename.
  121. 0,$0800,SAMPLE.BIN                ;Sample app, segment 1 (on server).
  122. 0,$8000,SAMPLE.BIN.2            ;Sample app, segment 2 (on server).
  123. 0,$9000,SAMPLE.BIN.3            ;Sample app, segment 3 (on server).
  124. $80,$800                        ;Starting address.
  125. $                                ;Display starting address in hex.
  126. $                                ;Display application size in hex.
  127. N                                ;Skip save file prompt (and don't save it).
  128. $FF,0,SAMPLE.SYSTEM                ;Target filename, filetype, and auxtype.
  129.  
  130. The difference is the 8th line.  This is new.  You don't have to be prompted from
  131. the keyboard anymore.  You can put a Y,N, or Q here instead of typing it.  If you
  132. don't put one of these letters (lowercase is okay, too), then you will be prompted
  133. from the keyboard.  As a convention, I recommend a ? if you want to be prompted.
  134.  
  135.  
  136. 2)    The runtime and macros have been revised a few times lately.  One of these
  137.     changes was to optimize _decout, _add, _sub, _mul, _div, _set, _index,
  138.     _getb, _getw, _putb, and _putw.  This was a bad idea, since it makes it
  139.     even more difficult to do Dynamo versions for other assemblers and keep
  140.     them as compatible as possible.  This feature in the MPW version caused
  141.     a greater leel of incompatibility, so I have removed it.  There is a
  142.     benefit that remained.  There were some entry points added for the array
  143.     indexing and accessing routines for the optimizations.  These entry points
  144.     are still there.  Given that _index, _getb, _getw, _putb, and _putw are no
  145.     longer figuring out which entry point to call, there have been some macros
  146.     added.  These are (logically enough) _indexl, _getbl, _getwl, _putbl, and
  147.     _putwl.  These don't load a 2-byte constant into the accumulator and
  148.     y-register.  Rather, they load a one byte value into the accumulator and
  149.     then call the alternate entry point (which loads the accumulator with 0
  150.     and branches to the regular entry point).  If you have a constant in the
  151.     range 0-255, as an optional syntax, you can still call _getb, _getw, _putb,
  152.     and _putw, as long as you put a < in the constant parameter to indicate it
  153.     is a 1-byte value.  For _index, this is the ONLY way to just load the
  154.     accumulator and call the alternate entry point.  There is no _indexl
  155.     macro.  The reason for this is that you can have multiple indexes for
  156.     one instance of _index, so each parameter needs to demonstrate if it is
  157.     a 1-byte or 2-byte value.  Some syntax examples would be:
  158.         _index        #345,,<#3
  159.         _getw        var1,<#3
  160.  
  161.     A constant parameter can now take these following forms and it produces
  162.     the following code:
  163.         1)    = #constant
  164.                 lda #<constant
  165.                 ldy #>constant
  166.         2)    = *address
  167.                 lda address
  168.                 ldy address+1
  169.         3)    = #<constant
  170.                 lda #<constant
  171.         4)    = *<address
  172.                 lda address
  173.  
  174.     As a sample we want to calculate the number of bytes necessary to store a
  175.     rectangle of data on the screen.  We have a rectangle stored at $4000, in
  176.     the form x1,y1,x2,y2.  The x-values take two bytes (0-280), and the y-values
  177.     take 1 byte (0-192).  How many bytes do this take?
  178.         First, we calculate which row we are starting in.
  179.  
  180.         The formula is:  bytes = (int((x2 + 6) / 7) - int(x1 / 7) * (y2 - y1)
  181.         The macros to do this formula would look like:
  182.  
  183.             rect    equ        $4000
  184.             x1        equ        0
  185.             y1        equ        2
  186.             x2        equ        3
  187.             y2        equ        5
  188.  
  189.     1)                _set    temp,*rect+x1        ;temp = x1
  190.     2)                _div    ,#<7                ;temp = int(x1 / 7)
  191.     3)                _set    bytes,*rect+x2        ;bytes = x2
  192.     4)                _add    ,#<6                ;temp = x2 + 6
  193.     5)                _div    ,#<7                ;bytes = int((x2 + 6) / 7)
  194.     6)                _subvar    ,temp                ;bytes = bytes - temp
  195.                                                 ;We now have # of bytes wide (in bytes).
  196.     7)                _set    temp,*<rect+y2        ;temp = y2
  197.     8)                _sub    ,*<rect+y1            ;temp = y2 - y1
  198.     9)                _mul    bytes,temp            ;bytes = bytes * temp
  199.  
  200.         The code for these macros would look like:
  201.     1)                ldx        #temp
  202.                     lda        rect+x1
  203.                     ldy        rect+x1+1
  204.                     jsr        setcon                ;Set temp to a 2-byte value.
  205.  
  206.     2)                lda        #<7
  207.                     jsr        divconl                ;Divide temp by a 1-byte constant.
  208.  
  209.     3)                ldx        #bytes
  210.                     lda        rect+x2
  211.                     ldy        rect+x2+1
  212.                     jsr        setcon                ;Set bytes to a 2-byte value.
  213.  
  214.     4)                lda        #<6
  215.                     jsr        addconl                ;Add a 1-byte constant to bytes.
  216.  
  217.     5)                lda        #<7
  218.                     jsr        divconl                ;Divide bytes by a 1-byte constant.
  219.  
  220.     6)                ldy        #temp
  221.                     jsr        subvar                ;Subtract temp from bytes.
  222.  
  223.     7)                ldx        #temp
  224.                     lda        rect+y2
  225.                     jsr        setconl                ;Set temp to a 1-byte value.
  226.  
  227.     8)                lda        rect+y1
  228.                     jsr        subconl                ;Subtract a 1-byte value from temp.
  229.  
  230.     9)                ldx        #bytes
  231.                     ldy        #temp
  232.                     jsr        mulvar                ;bytes = bytes * temp
  233.  
  234.         Since the y-values are only 1 byte, it is less code to write steps 7-9 like this:
  235.                     lda        rect+y2
  236.                     sec
  237.                     sbc        rect+y1
  238.                     _mull
  239.         Note that bytes didn't have to be redeclared for the multiply.  It is still
  240.         around from step 3.  (Steps 4 thru 6 start with a comma, thus leaving the
  241.         x-register alone.)  Also note that we said _mull, NOT _mul.  Since we are
  242.         not stating what we are multiplying by, we aren't telling the macros how
  243.         big the value is.  Since it doesn't know, it has to assume we know what we
  244.         are doing.  If we said _mul, it would assume that we wanted to multiply by
  245.         a 2-byte value, and the y-register would hold the hi-byte.  That isn't what
  246.         we want in this case.  We want to multiply by a 1-byte value, so we have to
  247.         use the _mull macro instead.  This needs to be watched carefully!! 
  248.  
  249.         So, we used the macros when it helped (readability and/or code size) and wrote
  250.         regular assembly code when it was easy and smaller.  The best of both worlds!!
  251.  
  252.  
  253. 3)    Another runtime change that stayed in is a value called strvalcount.  This
  254.     value is calculated by _strval and _midstrval.  strvalcount is the number
  255.     of characters involved in the evaluation of the string value.  Some examples:
  256.  
  257.         _strval of:  -$100FG                            returns -4111 (or 61425) 
  258.                                                         and sets strvalcount to 6.
  259.  
  260.         _midstrval(from char 4) of:  ------345.6789        returns 345 (two minuses
  261.                                                         cancel each other out) and
  262.                                                         sets strvalcount to 5.
  263.  
  264.     This addition is very useful when parsing a string.  If you pull an integer
  265.     value from a string, you may want to know how many characters the runtime
  266.     routine used.  If this value wasn't set, you would have to know all of the
  267.     rules that the runtime used to evaluate the integer and walk through the
  268.     string again yourself.  This is wasteful, and also can be a problem if the
  269.     evaluation method is ever changed.  If that occured, you would have to change
  270.     code in more than one place.  strvalcount is not returned in any register.
  271.     The registers are all used already.  Also, you commonly don't care about this
  272.     value.  (When you do care, you need it badly.)  strvalcount is simply a byte
  273.     value that you have external access to.  If you want it, just load it.
  274.  
  275.  
  276. 4)    Another _strval or _midstrval calculated value is strvaldigit.  This tells
  277.     you if the string evaluation routine actually found any digits.  When you
  278.     are returned a value of 0, you don't know if this was because there was a
  279.     value of 0 (or -$0000 for that matter), or because the routine ran into a
  280.     non-integer character before it could find any characters to evaluate.  The
  281.     strvaldigit value tells you which occured.  It holds the number of digit
  282.     characters encountered.  (If strvaldigit is 0, then the integer result must
  283.     also be 0.)  Note that strvalcount can be greater than 0 even if strvaldigit
  284.     is 0.  This would occur in the string: -$G  In this case strvalcount would be
  285.     2 (the - and the $) and strvaldigit would be 0 (there were no legal digits).
  286.  
  287.  
  288. 5)    Another change (kind of big, kind of small) is how the variable space is
  289.     defined.  It used to be that varstart was equated in app.config.  If it
  290.     changed, the runtime has to be reassembled and turned into a library again.
  291.     This has been leading to errors that are time consuming to trace.  Instead,
  292.     what is being done is to let the linker worry about it.  There now needs to
  293.     be a varspace space (256 bytes) for the linker to link in.  Once this is
  294.     done, varspace can be kept, or you can use LinkIIGS and MakeBigIIGS to throw
  295.     it away.  The runtime doesn't demand that varspace be part of your program.
  296.     All it cares about is that there are 256 bytes somewhere in memory that it
  297.     will access.  So, it isn't necessary that the application carry these 256
  298.     bytes around.  (Save disk space -- just say no!!)  It is necessary to have
  299.     something for the linker to work with, however.  So, the sample application
  300.     now has an additional segment called varspace.  It is thrown away in this
  301.     example.  This is done by linking it into a separate segment that we don't
  302.     care about.  Check out the make file for exactly how this is done.
  303.     It is worth noting that if you wish to move where the 256-byte varspace
  304.     area is, all you need to do is change the makefile.  Just change the -org
  305.     value for the segment "trash".
  306.  
  307. 6)    More support for indirection and dereferencing has been added.  There are now
  308.     an additional macro for dereferencing, as well as syntax extensions to handle
  309.     multi-level-dereferencing in conjunction with other macros.  Here is some code
  310.     from sample.a that demonstrates the extent of the indirection capabilities:
  311.  
  312.         _set    var1,**@ptr1        ;Set var1 to double-dereferenced @ptr1.
  313.                                     ;var1 has address @ptr3 now.
  314.         _add    ,#<2                ;Add 2 to the pointer.
  315.         _vderef                        ;Dereference var1 again (into itself).
  316.                                     ;var1 has address @ptr4 now.
  317.         _vderef                        ;Dereference var1 again (into itself).
  318.                                     ;var1 has address @ptr5 now.
  319.         _vderef                        ;Dereference var1 again (into itself).
  320.                                     ;var1 has value from @ptr5 now.
  321.         _vhexout                    ;Output the variable value (which is $1234)
  322.         jmp        @past
  323.  
  324. @ptr1        dc.w    @ptr2
  325. @ptr2        dc.w    @ptr3
  326. @ptr3        dc.w    0,@ptr4
  327. @ptr4        dc.w    @ptr5
  328. @ptr5        dc.w    $1234
  329.  
  330. @past        equ        *
  331.  
  332.  
  333.  
  334.  
  335. Well, this ought to be enough arbitrary changes for version 3.1 -- have fun.
  336.  
  337.  
  338.  
  339. Eric Soldan, Apple II DTS
  340.  
  341.  
  342. _______________________________________________________________________________
  343.  
  344.  
  345. Dynamo 3.0 information:
  346.  
  347. Some new stuff and some cool ideas:
  348.  
  349. If you are familiar with previous versions of Dynamo, you will see that a
  350. number of things have changed and have been reorganized.  The structure is
  351. more conducive to multiple-project development.  Since Dynamo is localized
  352. and the include files are available to AsmIIGS just like other include files,
  353. Dynamo version control is easier.  It is no longer so tempting to make a
  354. simple custom change to the Dynamo run-time for just one application, and
  355. therefore end up with multiple versions of Dynamo for different projects.
  356.  
  357. Another big change is that the source code for BUILDAPP.SYSTEM is now
  358. included.  This is so that extensions in the application build and launch
  359. process can be done by others to better suit their needs.  Currently,
  360. BUILDAPP.SYSTEM simply moves the code to the bank and memory location
  361. described in the build script.  Some more complex methods might be needed
  362. for more complex applications.  An application may need overlays, for
  363. example.  There may be two blocks of code that actually need to run at
  364. the same location, just at different times.  A revised BUILDAPP.SYSTEM
  365. could put these so-designated segments in auxiliary memory, and then the
  366. application could move them to main memory when needed.
  367.  
  368. For example:  Here is a simple idea for an overlay system:
  369.  
  370. BUILDAPP.SYSTEM could move designated files to aux ram when it is moving
  371. segments around at application launch time.  This could even be done by
  372. using ProDOS to save the range of memory to /RAM5.  When the main
  373. application needs the code segment, it could simply use ProDOS to load it
  374. into main memory.
  375.  
  376. Here's a reasonably simple approach to overlays:  When you want to call
  377. a segment of code that may or may not be in main memory, do a JSR to 
  378. an overlay management routine.  (Dynamic segments kind of work this way
  379. on the IIGS.)  The code would look something like:
  380.  
  381.         sec                     ;Input for overlay code.
  382.         lda     value           ;Input for overlay code.
  383.         ldy     value+1         ;Input for overlay code.
  384.         ldx     mode            ;Input for overlay code.
  385.  
  386.         jsr     overlay
  387.         dc.b    jiffyCoolCode   ;Segment # we want to call.
  388.  
  389. The overlay manager would first save the registers and processor status.
  390. Then it would use the return address on the stack to figure out where the
  391. jiffyCoolCode segment number is in memory.  It would then get this byte
  392. from memory.  Once this is done, the return address would be incremented 
  393. by 1 and pushed back onto the stack.
  394.  
  395. Now that we have the overlay segment #, we would use this to load the
  396. segment from /RAM5.  Once it is loaded, the registers and processor status
  397. would be put back to what they were when the overlay manager was called.
  398. Once this is done, the overlay manager would jump to where the code was
  399. loaded.
  400.  
  401. A little more logic could be added to see if the code segment requested
  402. is already in main memory.  (Old segment # = requested segment #.)  If
  403. it is, then the loading of the code could be skipped.
  404.  
  405. As you can see, doing overlays isn't so tough after all.  A simple
  406. system like this can really free up a lot of main ram on an Apple II.
  407.  
  408. For more readability, a macro could be used to call the overlay code.
  409. The call might look like:
  410.  
  411.         _jsr    jiffyCoolCode
  412.  
  413. The macro would expand to the calling convention shown above.
  414.  
  415. Any rate, given that BUILDAPP.SYSTEM isn't the final solution for
  416. everybody, I supplied the code so that everybody could change it
  417. if they wanted to.
  418.  
  419.  
  420. Eric Soldan, Apple II DTS
  421.